package com.dcm.groupbuy.mapper;

import com.dcm.groupbuy.entity.GroupBuyEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 牛浩
 */
@Component
public interface GroupBuyMapper {
    /**
     * 数据库查询全部
     * @return
     */
    List<GroupBuyEntity> findAll();

    /**
     * 根据id删除
     * @param id
     */
    void delete(Long id);

    /**
     * 添加
     * @param groupBuyEntity
     */
    void insertGroupBuy(GroupBuyEntity groupBuyEntity);

    /**
     * 修改
     * @param groupBuyEntity
     */
    void updateGroupBuy(GroupBuyEntity groupBuyEntity);

    /**
     * 模糊
     * @param groupState
     * @param groupName
     * @return
     */
    List<GroupBuyEntity> search(@Param("groupState") Integer groupState,@Param("groupName") String groupName);
}
